package com.grandstream.website.app.common;

public class Util {
	/**
	 * @Description: TODO 判断多个对象是否为空
	 * @param objs  eg:Util.judgeObjectNotNull("s",null,"","sa")
	 * @return 不为空返回true；为空返回false;
	 * @author czheng
	 * @date 2011-5-22
	 */
	public static boolean judgeObjectNotNull(Object ...objs) {
		for(Object obj :objs){
			if (obj == null) {
				return false;
			}
			if (obj instanceof String && obj.equals("")) {
				return false;
			}
			
			if(obj instanceof java.util.Collection){
				if(((java.util.Collection<?>) obj).isEmpty()){
					return false;
				}
			}
			if(obj instanceof Object[]){
				if(((Object[]) obj).length ==0){
					return false;
				}
			}
		}
		return true;
	}

	public static String interceptStrEnd(String str,String sign){
		if(!judgeObjectNotNull(str,sign)){return "";};
		return str.substring(str.lastIndexOf(sign)+1,str.length());
	}
}
